package proxy.test;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by chinalin on 2017/3/22.
 */
public class Client {

    public static void main(String[] args) {
        List<Proxy> proxyList = new ArrayList<Proxy>();
        proxyList.add(new EndProxy());
        proxyList.add(new BeforeProxy());
        proxyList.add(new Before1Proxy());
        proxyList.add(new AfterProxy());
        proxyList.add(new After1Proxy());

        ProxyFactory proxyFactory = new ProxyFactory(GreetingImpl.class, proxyList);
        GreetingImpl greetingProxy = proxyFactory.createProxy();

        greetingProxy.sayHello("Jack");
    }
}
